import React from "react";
import { isLogin } from "@/utils";
import { Outlet, Navigate, useLocation } from "umi";
export default function auth() {
  console.log(isLogin());

  return (
    <>
      {isLogin() ? (
        <Outlet />
      ) : (
        <Navigate to="/login" state={{ from: useLocation().pathname }} />
      )}
    </>
  );
}
